<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    

    <script>


        console.log("10")
        console.log(20)
        console.log("helloworld");

        //定义立即执行函数,语法方式一
       (function(){
            var a = 10;
            console.log("自执行函数1："+a);
       })();

        //定义立即执行函数,语法方式2
       (function(){
            var a = 20;
            console.log("自执行函数2："+a);
       }());




       

     


    </script>
</body>
</html>